package com.controller.admin;

import com.service.user.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class AdminFeedBackController {
    @Autowired
    OrderService orderService;

    @PostMapping("admin/getAllFeedBack")
    public List<Map<String, Object>> getAllFeedBack(
            @RequestParam("pageSize") int pageSize, @RequestParam("pageIndex") int pageIndex) {
        return orderService.getAllFeedBack(pageSize, pageIndex);
    }
    @PostMapping("admin/getAllFeedBackCount")
    public String getAllFeedBackCount() {
        int count = orderService.getAllFeedBackCount();
        return String.valueOf(count);
    }
}
